﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DependencyInjectionHost.cs" company="Witcraft LLC">
//   COPYRIGHT TEXT
// </copyright>
// <summary>
//   service 1 service factory.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.ServiceModel;

namespace WCFFacility
{
    /// <summary>
    /// Dependency injection service host.
    /// </summary>
    public class DependencyInjectionHost : ServiceHost
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DependencyInjectionHost"/> class.
        /// </summary>
        public DependencyInjectionHost()
            : base()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DependencyInjectionHost"/> class. 
        /// dependency injection host.
        /// </summary>
        /// <param name="serviceType">
        /// </param>
        /// <param name="baseAddresses">
        /// </param>
        public DependencyInjectionHost(Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        {
        }

        /// <summary>
        /// Invoked during the transition of a communication object into the opening state.
        /// </summary>
        protected override void OnOpening()
        {
            this.Description.Behaviors.Add(new DependencyInjectionServiceBehavior());
            base.OnOpening();
        }
    }
}